﻿		
   function windowonload(){
 
   	  var viewchar = "";
   	  for(var i=0;i<_ctype.length;i++)
   	  	{  
		   	  viewchar=_ctype.charAt(i);
		   	  switch (viewchar)
		   	  {
			   	  case"s":document.getElementById("_shortTitle").checked=true;break;
			   	  case"k":document.getElementById("_keywords").checked=true;break;
			   	  case"a":document.getElementById("_author").checked=true;break; 
			   	  case"p":document.getElementById("_smallPicUrl").checked=true;break;	  
			   	  case"c":document.getElementById("_smallContent").checked=true;break;
			   	  case"m":document.getElementById("_content").checked=true;break;  
			   	  case"f":document.getElementById("_uploadFile").checked=true;break;
			   	  case"t":document.getElementById("_availableDate").checked=true;break;
			   	  case"l":document.getElementById("_url").checked=true;break;
			   	  case"z":$("#viewtype1").attr("checked","checked");break;
			   	  case"b":$("#viewtype2").attr("checked","checked");break;
			   	  case"h":$("#viewtype3").attr("checked","checked");break;
			   	  case"d":$("#viewtype4").attr("checked","checked");break;
			  // 	  case"z":document.getElementById("_viewtype")[1].checked=true;break;  
				//  case"b":document.getElementById("_viewtype")[2].checked=true;break; 
				//  case"h":document.getElementById("_viewtype")[3].checked=true;break; 
				//  case"d":document.getElementById("_viewtype")[4].checked=true;break; 
		   	  }
    	  } 
  			
  	} 			
		
		
		
		
 function isEmpty(str){
			if(str==null || str.length==0){
			   return true;
			}else{
			   return false;
			}
		}	
		
function formSubmit(){
		    var newctype="";
		    if(document.getElementById("_shortTitle").checked){ newctype = newctype + 's'; }
		    if(document.getElementById("_keywords").checked){ newctype = newctype + 'k'; }
		    if(document.getElementById("_author").checked){ newctype = newctype + 'a'; }
		    if(document.getElementById("_smallPicUrl").checked){ newctype = newctype + 'p'; }
		    if(document.getElementById("_smallContent").checked){ newctype = newctype + 'c'; }
		    if(document.getElementById("_content").checked){ newctype = newctype + 'm'; }
		    if(document.getElementById("_uploadFile").checked){ newctype = newctype + 'f'; }
		    if(document.getElementById("_availableDate").checked){ newctype = newctype + 't'; }
		    if(document.getElementById("_url").checked){ newctype = newctype + 'l'; }
		    if($("#viewtype1").attr("checked")){ newctype = newctype + 'z'; }
            if($("#viewtype2").attr("checked")){ newctype = newctype + 'b'; } 
            if($("#viewtype3").attr("checked")){ newctype = newctype + 'h'; }   
            if($("#viewtype4").attr("checked")){ newctype = newctype + 'd'; }   
            	    
            document.getElementById("ctype").value = newctype;
		     
	   		document.form1.submit();
		}
   		
 

			    //限制只输入数字
			function number()
			{
			var char = String.fromCharCode(event.keyCode)
			var re = /[0-9]/g
			event.returnValue = char.match(re) != null ? true : false
			}
			
			function filterInput()
			{
			if (event.type.indexOf("key") != -1)
			{
			var re = /37|38|39|40/g
			if (event.keyCode.toString().match(re)) return false
			}
			event.srcElement.value = event.srcElement.value.replace(/[^0-9]/g, "")
			}
			
			function filterPaste()
			{
			var oTR = this.document.selection.createRange()
			var text = window.clipboardData.getData("text")
			oTR.text = text.replace(/[^0-9]/g, "")
			}		
		

		
		    function totop(){
	    	var   checktop   =   document.getElementsByName("checkboxtop");
	        if (checktop[0].checked){
	        	 document.getElementById('_showOrder').value = "置顶";
	      //  	 Ext.MessageBox.alert('提示框','置顶');
	        }else{
	            document.getElementById('_showOrder').value ="";
	        }
	    }	
			
	
		